﻿using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace TyMES.Communication.Request
{
    public class MaterialBindRequest : FactoryAPIBase.BaseRequest
    {
        [JsonPropertyName("lineCode")]
        public string LineCode { get; set; }

        [JsonPropertyName("requestTime")]
        public DateTime RequestTime { get; set; } 

        [JsonPropertyName("updateTime")]
        public DateTime UpdateTime { get; set; } 

        [JsonPropertyName("data")]
        public List<MaterialBindData> Data { get; set; }

        public MaterialBindRequest(string linecode,DateTime requesttime,DateTime updatetime,List<MaterialBindData> _data)
        {
            LineCode = linecode;
            RequestTime = requesttime;
            UpdateTime = updatetime;
            Data = _data;
            ServiceId = "Product004_MaterialBind";
        }
    }

    public class MaterialBindData
    {
        [JsonPropertyName("lineCode")]
        public string LineCode { get; set; }

        [JsonPropertyName("stationCode")]
        public string StationCode { get; set; }

        [JsonPropertyName("orderCode")]
        public string OrderCode { get; set; }

        [JsonPropertyName("scheduleCode")]
        public string ScheduleCode { get; set; }

        [JsonPropertyName("snNumber")]
        public string SnNumber { get; set; }

        [JsonPropertyName("assemblyMaterialCode")]
        public string AssemblyMaterialCode { get; set; }

        [JsonPropertyName("assemblyMaterialQty")]
        public string AssemblyMaterialQty { get; set; }

        [JsonPropertyName("assemblySort")]
        public string AssemblySort { get; set; }

        [JsonPropertyName("assemblyTime")]
        public DateTime AssemblyTime { get; set; } 

        [JsonPropertyName("assemblyMaterialName")]
        public string AssemblyMaterialName { get; set; }

        [JsonPropertyName("assemblyMaterialVersion")]
        public string AssemblyMaterialVersion { get; set; }

        [JsonPropertyName("assemblyMaterialSn")]
        public string AssemblyMaterialSn { get; set; }

        [JsonPropertyName("materialBatchNo")]
        public string MaterialBatchNo { get; set; }
    }
}
